#!/bin/bash
# This script effectively replicates the file format of gnokii in SMSreader mode.

if [ -z "$2" ]; then 
	echo SMSD Action Script - Error no details passed
	exit 1
fi

echo "$1"
echo "$2"

filename=/tmp/sms/sms_${1}_$(date +%s)_000
clean1filename="$(echo $filename | sed -r 's/ /_/g')"
clean2filename="$(echo $clean1filename | sed -r 's/\+//g')"

if [ -f /tmp/foo.txt ]
then
    	echo SMSD Action Script - The SMS file exists
	exit 1
fi

read var1
echo $var1
echo $var1>$clean2filename
exit 1


